<html>
<head>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(
		function() {
			$("button").click(
				function() {

						//$.getJSON("test.json", function(data){
						$.getJSON("service.jsp", function(data) {
/*
						alert('Success. Result: name => ' + data.name + ',' + 'balance => ' + data.balance);
						$("div").html('Success. Result: name => ' + data.name + ',' + 'balance => ' + data.balance);
						$("#mytable").append('<tr><td>' + data.name + '</td><td>' + data.balance + '</td></tr>');
*/						
						$.each(data.jsonChildarray, function(i,data){
							$("#mytable").append('<tr><td>' + data.B + '</td><td>' + i + '</td></tr>');
					    });
						
					});

				});
		});
</script>
</head>
<body>

	<table id="mytable">
		<tr>
			<th>Name</th>
			<th>Department</th>
		</tr>
	</table>

	<div>
		<h2>Let AJAX change this text</h2>
	</div>
	<button>Change Content</button>
</body>
</html>

